import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		// 左侧菜单栏数据
		menuItems: [{
			name: 'home', // 要跳转的路由名称 不是路径
			size: 18, // icon大小
			type: 'md-home', // icon类型
			text: '主页' // 文本内容
		}, {
			text: '二级菜单',
			type: 'ios-paper',
			children: [{
				type: 'ios-grid',
				name: 'tabel',
				text: '表格'
			}, {
				text: '图表',
				name: 'echarts',
				type: 'ios-paper',

			}]
		}, {
			text: '三级菜单',
			type: 'ios-paper',
			children: [{
				text: '饼图',
				name: 'barEcharts',
				type: 'ios-paper',

			}, {
				text: '仪表盘',
				name: 'dashBoard',
				type: 'ios-paper',

			}]
		}],
	},
	mutations: {
		setMenus(state, items) {
			state.menuItems = [...items]
		},
	}
})

export default store
